import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static String fun(double n, int m) {
        String s = "%." + String.valueOf(m) + "f";
        return String.format(s, n);
    }

    public static boolean isPrime(int n) {
        if (n <= 1) {
            return false;
        }
        if (n == 2) {
            return true;
        }
        if (n % 2 == 0) {
            return false;
        }
        for (int i = 3; i <= Math.sqrt(n); i+=2) {
            if (n % i == 0) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = 3;
        int[][] matrix = new int[n][n];
        for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                matrix[i][j] = scanner.nextInt();
            }
        }
        int sum1 = 0;
        int sum2 = 0;
        for(int i=0;i<n;i++){
            int j1 = i;
            int j2 = n - 1 - i;
            sum1 += matrix[i][j1];
            sum2 += matrix[i][j2];
        }
        System.out.println(sum1 + " " + sum2);
    }
}